﻿Imports System.ComponentModel
Public Class ExpensesClass
    Implements INotifyPropertyChanged

    Sub New()
        ' TODO: Complete member initialization 
    End Sub

    Public Event PropertyChanged( _
      ByVal sender As Object, _
      ByVal e As PropertyChangedEventArgs) _
      Implements INotifyPropertyChanged.PropertyChanged

    Protected Overridable Sub OnPropertyChanged(ByVal PropertyName As String)
        ' Raise the event, and make this procedure
        ' overridable, should someone want to inherit from
        ' this class and override this behavior:
        RaiseEvent PropertyChanged( _
          Me, New PropertyChangedEventArgs(PropertyName))
    End Sub

    Public Sub New(ByVal ExpenseType As String, ByVal ExpenseAmount As Decimal, ByVal ExpenseDate As Date, ByVal ExpenseId As Integer, ByVal ExpenseTypeId As Integer, ByVal ExpenseOneOff As Boolean, ByVal ExpenseComment As String)
        ' Set the backing field so that
        ' you don't raise the PropertyChanged event
        ' when you first create the Customer.
        _ExpenseType = ExpenseType
        _ExpenseAmount = ExpenseAmount
        _ExpenseDate = ExpenseDate
        _ExpenseId = ExpenseId
        _ExpenseTypeID = ExpenseTypeId
        _ExpenseOneOff = ExpenseOneOff
        _ExpenseComment = ExpenseComment
    End Sub

    Private _ExpenseType As String
    Private _ExpenseAmount As Decimal
    Private _ExpenseDate As Date
    Private _ExpenseId As Integer
    Private _ExpenseTypeID As Integer
    Private _ExpenseOneOff As Boolean
    Private _ExpenseComment As String
    Public Property ExpenseType() As String
        Get
            Return _ExpenseType
        End Get
        Set(ByVal value As String)
            If _ExpenseType <> value Then
                _ExpenseType = value
                OnPropertyChanged("ExpenseType")
            End If
        End Set
    End Property

    Public Property ExpenseAmount() As Decimal
        Get
            Return _ExpenseAmount
        End Get
        Set(ByVal value As Decimal)
            If _ExpenseAmount <> value Then
                _ExpenseAmount = value
                OnPropertyChanged("ExpenseAmount")
            End If
        End Set
    End Property

    Public Property ExpenseDate() As Date
        Get
            Return _ExpenseDate
        End Get
        Set(ByVal value As Date)
            If _ExpenseDate <> value Then
                _ExpenseDate = value
                OnPropertyChanged("ExpenseDate")
            End If
        End Set
    End Property

    Public Property ExpenseId() As Integer
        Get
            Return _ExpenseId
        End Get
        Set(ByVal value As Integer)
            If _ExpenseId <> value Then
                _ExpenseId = value
                OnPropertyChanged("ExpenseId")
            End If
        End Set
    End Property
    Public Property ExpenseTypeId() As Integer
        Get
            Return _ExpenseTypeID
        End Get
        Set(ByVal value As Integer)
            If _ExpenseTypeID <> value Then
                _ExpenseTypeID = value
                OnPropertyChanged("ExpenseTypeId")
            End If
        End Set
    End Property

    Public Property ExpenseOneOff() As Boolean
        Get
            Return _ExpenseOneOff
        End Get
        Set(ByVal value As Boolean)
            If _ExpenseOneOff <> value Then
                _ExpenseOneOff = value
                OnPropertyChanged("ExpenseOneOff")
            End If
        End Set
    End Property

    Public Property ExpenseComment() As String
        Get
            Return _ExpenseComment
        End Get
        Set(ByVal value As String)
            If _ExpenseComment <> value Then
                _ExpenseComment = value
                OnPropertyChanged("ExpenseComment")
            End If
        End Set
    End Property
End Class
